#pragma once
#include <QSystemTrayIcon>

class QMainWindow;
namespace Message
{
class TrayMessage : public QObject
{
    Q_OBJECT
    TrayMessage(QObject *obj = nullptr);
public:
    static TrayMessage *Ins();

    void registMainWindow(QMainWindow *mainWnd);
    void registTray(QSystemTrayIcon *tray);
    QMainWindow *mainWndPointer();
    void showMsg(const QString &title, const QString &msg, const QIcon &icon,
                 int msecs = 10000);

    void startTaskbarProgressFunc(int minVal = 0, int maxVal = 100);
    void setTaskBarProgressValueFunc(int val);
signals:
    void trayMsg(const QString &title, const QString &msg, const QIcon &icon,
                 int msecs = 10000);
    void startTaskBarProgress(int minVal = 0, int maxVal = 100);
    void setTaskBarProgressValue(int val);
};
}

